// invoice主表关联完毕
const {DataTypes, db } = require("../db");
db.define('vMain', {
id: {type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true,comment:'表自增ID'},
tenantId:{type: DataTypes.INTEGER,allowNull:false,comment:''}, 
printNo:{type: DataTypes.INTEGER,allowNull:false,comment:''}, 
billType:{type: DataTypes.STRING(50),allowNull:false,comment:''}, 
billState:{type: DataTypes.STRING(20),allowNull:false,comment:''}, 
billStateName:{type: DataTypes.STRING(100),comment:''}, 
billStateSort:{type: DataTypes.INTEGER,allowNull:false,comment:''}, 
transType:{type: DataTypes.INTEGER,allowNull:false,comment:''}, 
accId:{type: DataTypes.INTEGER,comment:''}, 
accAmount:{type: DataTypes.DECIMAL(20, 2),allowNull:false,comment:''}, 
accId1:{type: DataTypes.INTEGER,comment:''}, 
accAmount1:{type: DataTypes.DECIMAL(20, 2),allowNull:false,comment:''}, 
transTypeName:{type: DataTypes.STRING(50),allowNull:false,comment:''}, 
billDate:{type: DataTypes.STRING(10),allowNull:false,comment:''}, 
billNo:{type: DataTypes.STRING(128),allowNull:false,comment:''}, 
buId:{type: DataTypes.INTEGER,comment:''}, 
buName:{type: DataTypes.STRING(150),allowNull:false,comment:''}, 
contactCatId:{type: DataTypes.INTEGER,allowNull:false,comment:''}, 
contactCatName:{type: DataTypes.STRING(20),allowNull:false,comment:''}, 
deliverNames:{type: DataTypes.STRING(255),allowNull:false,comment:''}, 
totalDiscount:{type: DataTypes.DECIMAL(18, 2),allowNull:false,comment:''}, 
totalAmount:{type: DataTypes.DECIMAL(18, 2),allowNull:false,comment:''}, 
disAmount:{type: DataTypes.DECIMAL(18, 2),allowNull:false,comment:''}, 
rpAmount:{type: DataTypes.DECIMAL(18, 2),allowNull:false,comment:''}, 
ysAmount:{type: DataTypes.DECIMAL(18, 2),allowNull:false,comment:''}, 
amount:{type: DataTypes.DECIMAL(19, 2),comment:''}, 
arrears:{type: DataTypes.DECIMAL(21, 2),comment:''}, 
totalAmountReal:{type: DataTypes.DECIMAL(18, 2),comment:''}, 
disAmountReal:{type: DataTypes.DECIMAL(18, 2),comment:''}, 
rpAmountReal:{type: DataTypes.DECIMAL(18, 2),comment:''}, 
ysAmountReal:{type: DataTypes.DECIMAL(18, 2),comment:''}, 
amountReal:{type: DataTypes.DECIMAL(19, 2),comment:''}, 
arrearsReal:{type: DataTypes.DECIMAL(21, 2),comment:''}, 
cby:{type: DataTypes.INTEGER,comment:''}, 
cbyName:{type: DataTypes.STRING(128),allowNull:false,comment:''}, 
salesId:{type: DataTypes.INTEGER,comment:''}, 
salesName:{type: DataTypes.STRING(128),allowNull:false,comment:''}, 
createdAt:{type: DataTypes.STRING(20),allowNull:false,comment:''}, 
remark:{type: DataTypes.STRING(2000),comment:''}, 
linkName:{type: DataTypes.STRING(50),comment:''}, 
address:{type: DataTypes.STRING(255),comment:''}, 
deliverIds:{type: DataTypes.STRING(255),comment:''}, 
linkMobile:{type: DataTypes.STRING(50),comment:''}, 
linkPhone:{type: DataTypes.STRING(50),comment:''},
isProvider:{type: DataTypes.INTEGER,comment:''},
isCustomer:{type: DataTypes.INTEGER,comment:''}, 

}, {
    tableName: 'v_main',
    timestamps: false,
    comment: 'invoice主表关联完毕',
    
});